Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix parsing of Authorization header #94

Merged
merged 1 commit into from
Apr 26, 2016
Merged

fix parsing of Authorization header #94

merged 1 commit into from
Apr 26, 2016

Conversation

tomkukral
Copy link
Contributor

@tomkukral tomkukral commented Apr 25, 2016

Econe server fails with

<NoMethodError: undefined method `split' for nil:NilClass>

when using some clients (ec2 Ansible modules for example). The problem
lies in parsing Authentication header format.

Euca sends:

Credential=tom/20160425/undefined-19606/ec2/aws4_request, SignedHeaders=accept;accept-encoding;connection;content-length;content-type;host;x-amz-content-sha256;x-amz-date, Signature=fsomehash8cda2

Ansible EC2 module sends:

Credential=tom/20160425/servers/one/aws4_request,SignedHeaders=host;x-amz-date,Signature=6b2ccdsomehash39f2fc555

Previous implementation fails when fields are separated with "," (without space). Documentation [1] for AWS API says "are separated by a comma" so there should be just comma, but I'd prefer to maintain compatibility with euca and convert headers (remove spaces after comma).

[1] http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-auth-using-authorization-header.html

Econe server fails with <NoMethodError: undefined method `split' for nil:NilClass>
when using some clients (ec2 Ansible modules for example). The problem
lies in parsing Authentication header format.

Euca sends:
Credential=tom/20160425/undefined-19606/ec2/aws4_request, SignedHeaders=accept;accept-encoding;connection;content-length;content-type;host;x-amz-content-sha256;x-amz-date, Signature=fsomehash8cda2

Ansible EC2 module sends:
Credential=tom/20160425/servers/one/aws4_request,SignedHeaders=host;x-amz-date,Signature=6b2ccdsomehash39f2fc555

Previous implementation fails when fields are separated with ","
(without space). Documentation [1] for AWS API says "are separated by a
comma" so there should be just comma, but I'd prefer to maintain
compatibility with euca and convert headers (remove spaces after comma).

[1] http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-auth-using-authorization-header.html
@rsmontero rsmontero merged commit 53b0e18 into OpenNebula:master Apr 26, 2016
rsmontero pushed a commit that referenced this pull request Jul 15, 2020
rsmontero pushed a commit that referenced this pull request Oct 6, 2020
(cherry picked from commit eac7e1e)
rsmontero pushed a commit that referenced this pull request Jan 20, 2021
rsmontero pushed a commit that referenced this pull request Apr 13, 2021
(cherry picked from commit eac7e1e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants